#include "systick.h"

void SysTick_Delay_Nms(uint32_t Nms)
{
  if (Nms>1864)Nms=1864;

  SysTick->CTRL=0;
  SysTick->LOAD=Nms*9000-1;//unit:ms;counter n  n=t*f=Nms*9000 000 (s)
  SysTick->CTRL=0x01; //f=9M--refernce clock ,disable INT ,START SYSTIC
    //wait to 0;
  while((SysTick->CTRL&(1<<16))==0);//wait to 1;
  SysTick->CTRL=0; //close systick
  SysTick->VAL=0;
}

void SysTick_Delay_Nus(uint32_t Nus)
{